<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // var url="https://restapi.amap.com/v3/weather/weatherInfo?key=【你的_API_KEY】8&city=110000&extensions=all";
        // var http=new XMLHttpRequest();
        // http.open('get',url,'true');
        // http.onreadystatechange=function(){
        //     if(http.readyState ==4 && http.status  ==200){
        //         let data=http.responseText;
        //         //从服务器获得数据
        //         console.log(data);
        //     }
        // }
        // http.send();
        //郭超
        let arr = [1, 5, 3, 4, 1, 3 ,2 ];
        let myset= new Set();
        // for(var i=0;i<arr.length;i++){
        //     myset.add(arr[i]);
        // }

        arr.forEach(element => 
            myset.add(element)
        );

        let ok=[...myset];
        console.log(ok);
        
    </script>
</body>
</html>